package com.zzty.txj1.dao;

import com.zzty.txj1.entity.Location;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface LocationDao {
    @Select("select * from location where id=#{id}")
    Location getLocationById(Location location);

    @Insert("insert into location (name,x,y) values(#{name},#{x},#{y})")
    Integer addLocation(Location location);

    @Select("select * from location")
    List<Location> getAllLocation();

    @Delete("delete from location where id=#{id}")
    Integer deleteLocationById(Location location);

    @Update("update location set name=#{name},x=#{x},y=#{y} where id=#{id}")
    Integer updateLocationById(Location location);
}
